package com.sljy.hzk.ui.fragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;

import com.sljy.hzk.R;
import com.sljy.hzk.entity.ExamHistotyEntity;
import com.sljy.hzk.entity.ExamMainEntity;
import com.sljy.hzk.ui.fragment.lazyfragment.LazyFragment;
import com.sljy.hzk.view.DividerItemDecoration;
import com.sljy.hzk.view.adapter.ExamHistoryAdapter;

import java.util.List;

import butterknife.BindView;

/**
 * Created  on 2018/7/4 0004
 *
 * @author 唐开阔
 * @describe
 */
public class ExamHistoryFragment extends LazyFragment {
    @BindView(R.id.recycer)
    RecyclerView recycerView;
    public ExamHistoryAdapter examHHistoryAdapter;
    private List<ExamHistotyEntity.ExamInfo> hisRecordsBeanList;
    public static ExamHistoryFragment get( List<ExamHistotyEntity.ExamInfo> hisRecordsBeanList){
        ExamHistoryFragment fragment = new ExamHistoryFragment();
        fragment.hisRecordsBeanList = hisRecordsBeanList;
        return fragment;
    }
    @Override
    protected int getResId() {
        return R.layout.fragment_exam_history;
    }

    @Override
    protected void onRealViewLoaded(View view) {
        examHHistoryAdapter = new ExamHistoryAdapter(hisRecordsBeanList,getContext());
        recycerView.setLayoutManager(new LinearLayoutManager(getContext()));
        recycerView.addItemDecoration(new DividerItemDecoration(getContext(), LinearLayout.VERTICAL));
        recycerView.setAdapter(examHHistoryAdapter);
    }
}
